From 2ccd6fd5d7dd8058a79578d46fa543c19fbb8055 Mon Sep 17 00:00:00 2001 From: Kristian Rietveld Date: Thu, 24 Jan 2002 22:07:35 +0000 Subject: [PATCH] update docs, return current FALSE if x is smaller than the current visible Thu Jan 24 23:03:24 2002 Kristian Rietveld * gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): update docs, return current FALSE if x is smaller than the current visible area, not than the requested area, don't correct y coordinate, TREE_WINDOW_Y_TO_RBTREE_Y will do that. Fixes #67477. --- ChangeLog | 7 +++++++ ChangeLog.pre-2-0 | 7 +++++++ ChangeLog.pre-2-10 | 7 +++++++ ChangeLog.pre-2-2 | 7 +++++++ ChangeLog.pre-2-4 | 7 +++++++ ChangeLog.pre-2-6 | 7 +++++++ ChangeLog.pre-2-8 | 7 +++++++ gtk/gtktreeview.c | 21 +++++++++++---------- 8 files changed, 60 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 752ef5cf7a..b900d83a90 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Thu Jan 24 23:03:24 2002 Kristian Rietveld + + * gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): update docs, + return current FALSE if x is smaller than the current visible area, + not than the requested area, don't correct y coordinate, + TREE_WINDOW_Y_TO_RBTREE_Y will do that. Fixes #67477. + Thu Jan 24 15:41:08 2002 Jonathan Blandford * gtk/gtktreeview.c diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 752ef5cf7a..b900d83a90 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,10 @@ +Thu Jan 24 23:03:24 2002 Kristian Rietveld + + * gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): update docs, + return current FALSE if x is smaller than the current visible area, + not than the requested area, don't correct y coordinate, + TREE_WINDOW_Y_TO_RBTREE_Y will do that. Fixes #67477. + Thu Jan 24 15:41:08 2002 Jonathan Blandford * gtk/gtktreeview.c diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 752ef5cf7a..b900d83a90 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,10 @@ +Thu Jan 24 23:03:24 2002 Kristian Rietveld + + * gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): update docs, + return current FALSE if x is smaller than the current visible area, + not than the requested area, don't correct y coordinate, + TREE_WINDOW_Y_TO_RBTREE_Y will do that. Fixes #67477. + Thu Jan 24 15:41:08 2002 Jonathan Blandford * gtk/gtktreeview.c diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 752ef5cf7a..b900d83a90 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,10 @@ +Thu Jan 24 23:03:24 2002 Kristian Rietveld + + * gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): update docs, + return current FALSE if x is smaller than the current visible area, + not than the requested area, don't correct y coordinate, + TREE_WINDOW_Y_TO_RBTREE_Y will do that. Fixes #67477. + Thu Jan 24 15:41:08 2002 Jonathan Blandford * gtk/gtktreeview.c diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 752ef5cf7a..b900d83a90 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,10 @@ +Thu Jan 24 23:03:24 2002 Kristian Rietveld + + * gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): update docs, + return current FALSE if x is smaller than the current visible area, + not than the requested area, don't correct y coordinate, + TREE_WINDOW_Y_TO_RBTREE_Y will do that. Fixes #67477. + Thu Jan 24 15:41:08 2002 Jonathan Blandford * gtk/gtktreeview.c diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 752ef5cf7a..b900d83a90 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,10 @@ +Thu Jan 24 23:03:24 2002 Kristian Rietveld + + * gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): update docs, + return current FALSE if x is smaller than the current visible area, + not than the requested area, don't correct y coordinate, + TREE_WINDOW_Y_TO_RBTREE_Y will do that. Fixes #67477. + Thu Jan 24 15:41:08 2002 Jonathan Blandford * gtk/gtktreeview.c diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 752ef5cf7a..b900d83a90 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,10 @@ +Thu Jan 24 23:03:24 2002 Kristian Rietveld + + * gtk/gtktreeview.c (gtk_tree_view_get_path_at_pos): update docs, + return current FALSE if x is smaller than the current visible area, + not than the requested area, don't correct y coordinate, + TREE_WINDOW_Y_TO_RBTREE_Y will do that. Fixes #67477. + Thu Jan 24 15:41:08 2002 Jonathan Blandford * gtk/gtktreeview.c diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 2037823afd..ebcfa7e1bd 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -8355,14 +8355,15 @@ gtk_tree_view_get_bin_window (GtkTreeView *tree_view) * @cell_y: A pointer where the Y coordinate relative to the cell can be placed, or %NULL * * Finds the path at the point (@x, @y), relative to widget coordinates. That - * is, @x and @y are relative to an events coordinates. It is primarily for - * things like popup menus. If @path is non-%NULL, then it will be filled with - * the #GtkTreePath at that point. This path should be freed with - * gtk_tree_path_free(). If @column is non-%NULL, then it will be filled with - * the column at that point. @cell_x and @cell_y return the coordinates relative - * to the cell background (i.e. the @background_area passed to - * gtk_cell_renderer_render()). This function is only meaningful if @tree_view - * is realized. + * is, @x and @y are relative to an events coordinates. @x and @y must come + * from an event on the @tree_view only where event->window == + * gtk_tree_view_get_bin (). It is primarily for things like popup menus. + * If @path is non-%NULL, then it will be filled with the #GtkTreePath at that + * point. This path should be freed with gtk_tree_path_free(). If @column + * is non-%NULL, then it will be filled with the column at that point. + * @cell_x and @cell_y return the coordinates relative to the cell background + * (i.e. the @background_area passed to gtk_cell_renderer_render()). This + * function is only meaningful if @tree_view is realized. * * Return value: %TRUE if a row exists at that coordinate. **/ @@ -8390,7 +8391,7 @@ gtk_tree_view_get_path_at_pos (GtkTreeView *tree_view, if (tree_view->priv->tree == NULL) return FALSE; - if (x > tree_view->priv->hadjustment->upper) + if (x > tree_view->priv->hadjustment->page_size) return FALSE; if (x < 0 || y < 0) @@ -8438,7 +8439,7 @@ gtk_tree_view_get_path_at_pos (GtkTreeView *tree_view, } y_offset = _gtk_rbtree_find_offset (tree_view->priv->tree, - TREE_WINDOW_Y_TO_RBTREE_Y (tree_view, y + tree_view->priv->vadjustment->value), + TREE_WINDOW_Y_TO_RBTREE_Y (tree_view, y), &tree, &node); if (tree == NULL) -- 2.30.2